package com.javafactroy.kunlong.data.service;

import com.javafactroy.kunlong.data.dao.mysql.QueryConditionApiMapper;
import com.javafactroy.kunlong.data.entity.QueryConditionApiEntity;
import com.javafactroy.kunlong.base.dto.TQueryParam;
import com.javafactroy.kunlong.base.model.ReturnPageInfo;

import org.apache.ibatis.annotations.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
*  @author raymond.lei@163.com
*  @date   2023-11-30 16:54:03

*/
@Slf4j
@Service
public class QueryConditionService extends GeneralService<QueryConditionApiEntity, QueryConditionApiMapper> {

    public QueryConditionService() {
        genricParam = () -> new QueryConditionApiEntity();
    }

    public ReturnPageInfo<QueryConditionApiEntity> queryParam(@Param("queryParam") TQueryParam<QueryConditionApiEntity> queryParam) {
        if ( queryParam.getParam() == null ) {
            queryParam.setParam(new QueryConditionApiEntity());
        }

        return super.queryParam(queryParam);

    }
}
